package com.jp.juc.base;

public class JvmMemory {
    public static void main(String[] args) {
        Runtime runtime = Runtime.getRuntime();
        // 总内存
        System.out.println("runtime.maxMemory() = " + runtime.maxMemory());
        // 已用内存
        System.out.println("runtime.totalMemory() = " + runtime.totalMemory());
        // 可用内存
        System.out.println("runtime.freeMemory() = " + runtime.freeMemory());
    }
}
